package admin

import "github.com/google/uuid"

type GetUsersRequest struct {
	Page  int `json:"page" validate:"omitempty,min=1"`
	Limit int `json:"limit" validate:"omitempty,min=1,max=100"`
}

type GetUsersResponse struct {
	Rows       []UserRow `json:"rows"`
	Total      int64     `json:"total"`
	Page       int       `json:"page"`
	Limit      int       `json:"limit"`
	TotalPages int64     `json:"total_pages"`
}

type UserRow struct {
	ID        uuid.UUID `json:"id"`
	Username  string    `json:"username"`
	CreatedAt int64     `json:"created_at"`
	UpdatedAt int64     `json:"updated_at"`
}

type GetUserDetailRequest struct {
	ID uuid.UUID `param:"id" validate:"required,uuid"`
}

type GetUserDetailResponse struct {
	ID                uuid.UUID `json:"id"`
	Username          string    `json:"username"`
	ConversationCount int64     `json:"conversation_count"`
	MessageCount      int64     `json:"message_count"`
	CreatedAt         int64     `json:"created_at"`
	UpdatedAt         int64     `json:"updated_at"`
}

type CreateUserRequest struct {
	Username string `json:"username" validate:"required,min=1,max=50"`
	Password string `json:"password" validate:"required,min=6,max=50"`
}

type CreateUserResponse struct {
	ID       uuid.UUID `json:"id"`
	Username string    `json:"username"`
}

type UpdateUserRequest struct {
	ID       uuid.UUID `param:"id" validate:"required,uuid"`
	Username *string   `json:"username" validate:"omitempty,min=1,max=50"`
	Password *string   `json:"password" validate:"omitempty,min=6,max=50"`
}

type DeleteUserRequest struct {
	ID uuid.UUID `param:"id" validate:"required,uuid"`
}

type ResetPasswordRequest struct {
	ID          uuid.UUID `param:"id" validate:"required,uuid"`
	NewPassword string    `json:"new_password" validate:"required,min=6,max=50"`
}
